import { Msg } from '@C/Msg'
import { obj_oto_query } from '@U/common'
import type { IObj } from '@/interface'

export default (appId: string, path = '/pages/Login/Login', params?: IObj) => {
    uni.navigateToMiniProgram({
        appId,
        envVersion: 'trial',
        path: `${path}?${obj_oto_query(params as IObj)}`,
        fail(err) {
            console.log(err)
            Msg({ icon: 'error', msg: '跳转失败' })
        },
    })
}